package com.ztgf.commodity.api.cms;

import com.ztgf.commodity.models.bo.CommoditySpecificationAttrSaveBO;
import com.ztgf.commodity.models.service.ICommoditySpecificationAttrService;
import com.ztgf.common.constant.Result;
import com.ztgf.common.enums.CodeEnum;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * author: chenyu.wang
 * date: 2020-06-01 15:17
 * Description:
 */
@RestController
@RequestMapping("/cms/commoditySpecificationAttr")
@Slf4j
@Api(value = "CommoditySpecificationAttrController", tags = "商品规格属性表接口")
public class CommoditySpecificationAttrController {

    @DubboReference
    private ICommoditySpecificationAttrService specificationAttrService;

    @PostMapping(value = "/insert")
    @ApiOperation(value = "添加商品规格属性表", notes = "添加商品规格属性表")
    public Result insert(CommoditySpecificationAttrSaveBO saveBO) {
        boolean flag = specificationAttrService.add(saveBO);
        if (flag) {
            return new Result<>();
        }
        return new Result<>(CodeEnum.FAIL_100007);
    }
}
